<template>
	<form @submit="form.submit($event,success)" :data-action="`/api/calibration/save?stationId=${param.id}`">
		
		<view class="fixAuto bb middle">
			<view class="w100">
				分析仪原理
			</view>
			<view>
				<input type="text" name="principle|分析仪原理" maxlength="200" placeholder="请输入分析仪原理">
			</view>
		</view>
		
		<view class="fixAuto bb middle">
			<view class="w100">
				分析仪量程
			</view>
			<view>
				<input type="digit" name="range|分析仪量程" placeholder="请输入分析仪量程">
			</view>
		</view>
		
		<view class="fixAuto bb middle">
			<view class="w100">
				计量单位
			</view>
			<view>
				<input type="text" name="unit|计量单位" maxlength="20" placeholder="请输入计量单位">
			</view>
		</view>
		<view class="grayBg pd5"></view>
		
		<view class="fz16 bold pd10 bb">
			零点漂移校准
		</view>
		
		<view class="fixAuto bb middle">
			<view class="w100">
				零点
			</view>
			<view>
				<input type="digit" name="zero|零点" placeholder="请输入零点">
			</view>
		</view>
		
		<view class="fixAuto bb middle">
			<view class="w100">
				零点校前值
			</view>
			<view>
				<input type="digit" name="beforeNum|零点校前值" placeholder="请输入零点校前值">
			</view>
		</view>
		
		<view class="fixAuto bb middle">
			<view class="w100">
				零点校后值
			</view>
			<view>
				<input type="digit" name="afterNum|零点校后值" placeholder="请输入零点校后值">
			</view>
		</view>
		
		<view class="fixAuto bb middle">
			<view class="w100">
				零点漂移
			</view>
			<view>
				<input type="digit" name="driven|零点漂移" placeholder="请输入零点漂移">
			</view>
		</view>
		
		<view class="father">
			<view class="fixAuto bb">
				<view class="w100">
					仪器校准状态
				</view>
				<view class="item ">
					<view class="flex ">
						<view :class="isNormal == 0 ? 'red' : 'green'">{{typeList[isNormal]}}</view>
						<view class="sIcon-arrowRight pl10 gray"></view>
						<input type="number" name="isNormal|仪器校准状态" :value="isNormal" style="display: none;"/>
					</view>
				</view>
			</view>
			<picker mode="selector" class="abs op0" :range="typeList" @change="isNormal=$event.detail.value">
				<view>请选择</view>
			</picker>
		</view>
		
		<view class="grayBg pd5"></view>
		
		<view class="fz16 bold pd10 bb">
			量程漂移校准
		</view>
		
		<view class="fixAuto bb middle">
			<view class="w100">
				标气浓度
			</view>
			<view>
				<input type="digit" name="gas|标气浓度" placeholder="请输入标气浓度">
			</view>
		</view>
		
		<view class="fixAuto bb middle">
			<view class="w100">
				量程校前值
			</view>
			<view>
				<input type="digit" name="rangebeforeNum|量程校前值" placeholder="请输入量程校前值">
			</view>
		</view>
		
		<view class="fixAuto bb middle">
			<view class="w100">
				量程校后值
			</view>
			<view>
				<input type="digit" name="rangeAfterNum|量程校后值" placeholder="请输入量程校后值">
			</view>
		</view>
		
		<view class="fixAuto bb middle">
			<view class="w100">
				量程漂移
			</view>
			<view>
				<input type="digit" name="rangeNum|量程漂移" placeholder="请输入量程漂移">
			</view>
		</view>
		
		<view class="father">
			<view class="fixAuto bb">
				<view class="w100">
					仪器校准状态
				</view>
				<view class="item ">
					<view class="flex ">
						<view :class="rangeIsNormal == 0 ? 'red' : 'green'">{{typeList[rangeIsNormal]}}</view>
						<view class="sIcon-arrowRight pl10 gray"></view>
						<input type="number" name="rangeIsNormal|仪器校准状态" :value="rangeIsNormal" style="display: none;"/>
					</view>
				</view>
			</view>
			<picker mode="selector" class="abs op0" :range="typeList" @change="rangeIsNormal=$event.detail.value">
				<view>请选择</view>
			</picker>
		</view>
		
		
		<view class="plr100 pd30">
			<button form-type="submit" class="btn block rds23">
				保存记录
			</button>
		</view>
		
	</form>
	
</template>

<script>
	export default {
		data() {
			return {
				param:{id:"",type:1} ,
				isNormal : 1 ,
				rangeIsNormal : 1 ,
				typeList : ["异常" ,"正常"]
			}
		},
		
		onLoad(param) {
			this.param = param ;
		},
		
		methods: {
			success:function(e){
				this.kit.goSuccessBack("保存成功");
			}
		}
	}
</script>

<style>
page{
	background-color: #fff;
}
.fixAuto{
	padding: 30upx 10upx;
}
</style>
